package com.bdbit.ChargingStation.repository;

import com.bdbit.ChargingStation.entity.ChargingOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ChargingOrderRepository extends JpaRepository<ChargingOrder, Long> {
    
    /**
     * 根据状态代码查询未删除的订单
     * @param status 状态代码
     * @return 订单列表
     */
    List<ChargingOrder> findByStatusAndIsDeleted(int status, int isDeleted);
    /**
     * 查询指定状态且开始时间为空且未逻辑删除的订单
     * @param status 状态代码
     * @param isDeleted 删除标记
     * @return 订单列表
     */
    List<ChargingOrder> findByStatusAndStartTimeIsNullAndIsDeleted(int status, int isDeleted);
}